package com.mhc.suzuki.constant;

/**
 * 审批业务类型枚举类
 * Created by HMJ on 2017/8/23.
 */
public enum ApplyTypeEnum {
    // 征信录入
    CREDITED(0, "征信录入"),
    // 贷款申请
    LOAN_APPLY(1, "贷款申请"),
    // 打款申请
    PAYMENT_REQUEST_APPLY(2, "打款申请"),
    // 通融申请
    ACCOM_APPLY(3, "通融申请"),
    // 修改申请
    MODIFY_APPLY(4, "修改申请"),
    // 通融过件审核
    ACCOM_REVIEW_AUDIT(5, "通融过件审核");

    private Integer code;
    private String name;

    ApplyTypeEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ApplyTypeEnum getApplyTypeEnum(Integer legNo) {
        for(ApplyTypeEnum applyTypeEnum : ApplyTypeEnum.values()){
            if(applyTypeEnum.code.equals(legNo)){
                return applyTypeEnum;
            }
        }
        //没有对应的类型，默认用其他类型
        return ApplyTypeEnum.LOAN_APPLY;
    }

}
